//
//  MLBLEModel.h
//  MLBLEStatic
//
//  Created by 程杰 on 2023/10/18.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
NS_ASSUME_NONNULL_BEGIN
@class MLBleParamsItem;
@class MLBleResultInfos;

@interface MLBLEModel : NSObject

///开启配网标记，0X00（已配网）/0X01(cobo需要配网)/0x02（ble模块需要配网）直接配网
@property (nonatomic,assign) NSInteger mlApState;
/// 信号强度
@property (nonatomic,strong) NSNumber *RSSI;
/**
    0 -蓝牙名称是"MLink_"开头-6类型;
    1-广播协议6667开头-7类型;
    2-火星人FA蓝牙
 */
@property (nonatomic,assign) NSInteger bleType;

@property (nonatomic,copy) NSString *deviceIdentifier;
/// kind
@property (nonatomic,copy) NSString *mlKind;
/// model
@property (nonatomic,copy) NSString *mlModel;
/// 协议版本号
@property (nonatomic,copy) NSString *mlVersionCode;
/// 是否是妙联的蓝牙
@property (nonatomic,assign) BOOL isMLble;
/// 设备图片
@property (nonatomic,copy) NSString *netImg;
/// 设备名字
@property (nonatomic,copy) NSString *netName;
/// 搜索到的蓝牙名字
@property (nonatomic,copy) NSString *name;
@property (nonatomic,copy) NSString *mac;
// 如阿里云：CodeStringValue
@property (nonatomic,copy) NSString *deviceName;
@property (nonatomic,strong) CBPeripheral *peripheral;
@property (nonatomic,strong) CBService *service;
//是否连接
@property (nonatomic,assign) BOOL connect;
//接收广播数据
@property (nonatomic,strong) NSDictionary *advertisementData;
@end



#pragma mark 蓝牙通信传入的参数
@interface MLBleParamsItem : NSObject

@property (nonatomic,strong) MLBLEModel *bleModel;
/// wifi密码
@property (nonatomic,copy) NSString *wifiPassWorld;
/// wifi名称
@property(nonatomic, copy) NSString *wifiName;
/// 超时时间，默认60秒，可不填
@property(nonatomic, assign) int overTime;

///只有是lot必填，其他选填，三方lot、例如亚马逊平台（PF和Port需要为NSNumber类型)
@property (nonatomic,strong) NSDictionary *lotDict;

//协议版本类型V2.0
@property(nonatomic, copy) NSString *verType;
//功能类型码
@property(nonatomic, copy) NSString *codeType;
@property (nonatomic,strong) CBPeripheral *peripheral;
#pragma mark -V2.0入参
@property(nonatomic, copy) NSString *type;
@property(nonatomic, copy) NSString *pToken;
@property(nonatomic, copy) NSString *aToken;
@property(nonatomic, copy) NSString *cmei;
@property(nonatomic, copy) NSString *sn;
@property(nonatomic, copy) NSString *ymd;
@property(nonatomic, copy) NSString *manufacturer;
@property(nonatomic, copy) NSString *brand;
@property(nonatomic, copy) NSString *version;
@property(nonatomic, copy) NSString *powerup;
@property(nonatomic, copy) NSString *mac;

@end



#pragma mark 蓝牙通信返回结果
@interface MLBleResultInfos : NSObject
/// 保留字段
@property (nonatomic,copy) NSString *bleType;
/// 最后状态bleModel
@property (nonatomic,strong) MLBLEModel *bleModel;

/// lot -配网返回结果信息
@property(nonatomic, copy) NSString *message;
/// lot - code
@property(nonatomic, assign) int code;

/// 配网状态
//@property (nonatomic,assign) MLBLEConnectState connectState;
;
#pragma mark -V2.0返回的结果
@property(nonatomic, copy) NSString *modelVer;// 模块版本号

@property(nonatomic, copy) NSString *type;
@property(nonatomic, copy) NSString *pToken;
@property(nonatomic, copy) NSString *aToken;
@property(nonatomic, copy) NSString *cmei;
@property(nonatomic, copy) NSString *sn;
@property(nonatomic, copy) NSString *ymd;
@property(nonatomic, copy) NSString *manufacturer;
@property(nonatomic, copy) NSString *brand;
@property(nonatomic, copy) NSString *version;
@property(nonatomic, copy) NSString *powerup;
@property(nonatomic, copy) NSString *mac;

@end

NS_ASSUME_NONNULL_END
